import models from '../../../models'

export default defineEventHandler(async (event: any) => {
  try {
    const id = event.context.params.id
    
    await models.User.destroy({
      where: { id }
    })
    
    return {
      success: true
    }
  } catch (error) {
    throw createError({
      statusCode: 500,
      message: '删除用户失败'
    })
  }
}) 